package com.glb.app.config;


import com.glb.app.store.MongodbChatMemoryStore;
import dev.langchain4j.memory.chat.ChatMemoryProvider;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import dev.langchain4j.store.memory.chat.InMemoryChatMemoryStore;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SeparateChatAssistantConfig {



    @Autowired
    private MongodbChatMemoryStore mongodbChatMemoryStore;
    @Bean
    public ChatMemoryProvider qwenChatMemoryProvider() {
        return memoryId->MessageWindowChatMemory.builder()
                .id(memoryId).maxMessages(10)
//                .chatMemoryStore(new InMemoryChatMemoryStore())
                .chatMemoryStore(mongodbChatMemoryStore)
                .build();
    }
}
